import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import JavaScriptUtility from '@runtime/base/Utility/JavaScriptUtility';
import WindowLoader from '@runtime/base/Loader/WindowLoader';
import RouterComponent from '@runtime/module/Router/RouterComponent';
import DirectiveComponent from '@runtime/module/Directive/DirectiveComponent';
import MessageDispatcherComponent from '@runtime/module/Dispatcher/MessageDispatcherComponent';

WindowLoader.Default.Initialize();
JavaScriptUtility.Default.Initialize();
MessageDispatcherComponent.Default.Register();

window.addEventListener('load', OnWindowLoad);

function OnWindowLoad(): void {
    const app = createApp(App);

    DirectiveComponent.Default.Register(app);
    app.use(RouterComponent.Default.Router);

    app.mount('#app');
}